home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d18
/
loancalc.arc
/
RROUND.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-04-28
|
394b
|
10 lines
FUNCTION RealRound(num: real; digits: integer): real;
{Round a real number to digits decimal places to the
right of the decimal point. Negative digits round
to the left of the decimal point.}
BEGIN
IF num >= 0 THEN
RealRound := RealTrunc(num + 0.5 * IntRaise(10, -digits), digits)
ELSE
RealRound := RealTrunc(num - 0.5 * IntRaise(10, -digits), digits)
END; {RealRound}